package eureka.customer.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * ribbon配置
 */
@Configuration
public class RibbonConfig {
    @Bean
    public IRule myRule(){
        return new RoundRobinRule();    //轮询策略
//        return new RandomRule();    //随机策略
    }
}
